<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * @author Russell Toris - rctoris@wpi.edu
<span class='line'>  3</span>  */</span><span class="WHIT">
<span class='line'>  4</span> 
<span class='line'>  5</span> </span><span class="COMM">/**
<span class='line'>  6</span>  * Create a grid object.
<span class='line'>  7</span>  * 
<span class='line'>  8</span>  * @constructor
<span class='line'>  9</span>  * @param options - object with following keys:
<span class='line'> 10</span>  *  * size (optional) - the size of the grid
<span class='line'> 11</span>  *  * color (optional) - the line color of the grid, like '#cccccc'
<span class='line'> 12</span>  *  * lineWidth (optional) - the width of the lines in the grid
<span class='line'> 13</span>  */</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="NAME">ROS3D.Grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">options</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">size</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.size</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">50</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">color</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.color</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">'#cccccc'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lineWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.lineWidth</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 19</span> 
<span class='line'> 20</span> </span><span class="WHIT">  </span><span class="COMM">// create the mesh</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT">  </span><span class="NAME">THREE.Mesh.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">THREE.PlaneGeometry</span><span class="PUNC">(</span><span class="NAME">size</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT">      </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">THREE.MeshBasicMaterial</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT">        </span><span class="NAME">color</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">color</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT">        </span><span class="NAME">wireframe</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT">        </span><span class="NAME">wireframeLinewidth</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">lineWidth</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT">        </span><span class="NAME">transparent</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="NAME">ROS3D.Grid.prototype.__proto__</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">THREE.Mesh.prototype</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 30</span> </span></pre></body></html>